当前位置:flash课件吧→FLASH8.0教程→ flash cs3视频教程 flashcs3教程 flash cs3教程下载 flashcs3视频教程 flash cs3 pro教程 flash cs3教程网 flash cs3 实例教程 flashcs3教程下载 flash cs3教程 pdf flash cs3按钮教程

我站原创视频教程,网上视频教程学校,仅需要一个耳机+远程即可完成所有教学任务。

题 目:大炮打敌机小游戏


主场景中ball的帧内容:


主场景中AS:
gun_mc._rotation=-40;
_root.ang=-40;
_root.total=0;
_root.attachMovie("fly","fly",10,{_x:random(300)+220,_y:random(220)+10});
up_btn.onPress=function(){
turnangle(5);
if(gun_mc._rotation<-85){
gun_mc._rotation=-85;
}
}
down_btn.onPress=function(){
turnangle(-5);
if(gun_mc._rotation>-5){
gun_mc._rotation=-5;
}
}
function turnangle(tmp){
gun_mc._rotation+=-1*tmp;
_root.ang=gun_mc._rotation;
}
fire_btn.onPress=function(){
if(_root.ball._currentframe==1){
_root.ball.gotoAndPlay(2);
}
}

//------------------------------------

ball中第一帧:
stop ();
_visible = false;

第二帧:
var rad = -_root.ang/180*Math.PI;
_x = _root.gun_mc._x+80*Math.cos(rad);
_y = _root.gun_mc._y-80*Math.sin(rad);
var Vx = Math.sqrt(750)*Math.cos(rad);
var Vy = -1*Math.sqrt(750)*Math.sin(rad);
_visible = true;

第三帧:
var hitMon = this.hitTest(_root.fly);
if (hitMon) {
gotoAndPlay("HitBang");
}
_x += Vx;
_y += Vy;
Vy++;
if (_y>=350 || _x>550) {
gotoAndPlay("Bang");
}
trace(1);

第四帧:
gotoAndPlay (_currentframe-1);

第16帧:
gotoAndStop(1);

第17 帧
:_root.fly.removeMovieClip();
_root.total++;

第26帧
:_root.attachMovie("fly", "fly", 10, {_x:random(300)+220, _y:random(220)+10});
gotoAndStop(1);
//------------------------------------------

你也可以试试.

 

 

 

 

省级FLASH课件制作培训请加我站管理QQ444860709 培训QQ专业群67042004。

FLASH8.0教程→ flash cs3视频教程 flashcs3教程 flash cs3教程下载 flashcs3视频教程 flash cs3 pro教程 flash cs3教程网 flash cs3 实例教程 flashcs3教程下载 flash cs3教程 pdf flash cs3按钮教程

期刊论文服务

合作期刊
学报期刊
 
获奖证书办理
本站已改版成新站 课件115学培吧http://www.kj115.com
在线咨询台